 
<!--微信裂变具体数据-->  


<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/baseui/css/amazeui.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/baseui/css/admin.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/style.css"/>




<!--[if (gte IE 9)|!(IE)]><!-->
	<script type="text/javascript" src="//cdn.bootcss.com/jquery/2.2.2/jquery.min.js"></script>
	<script type="text/javascript" src="//cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>
  	<script>$(function() {FastClick.attach(document.body);});</script>
<!--<![endif]-->

<!--[if lte IE 8 ]>
	<script type="text/javascript" src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
	<script type="text/javascript" src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
	<script type="text/javascript" src="__STATIC__/weixin/assets/sell/baseui/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<script type="text/javascript" src="//cdn.bootcss.com/amazeui/2.7.2/js/amazeui.min.js"></script>


<div class="am-modal am-modal-alert" tabindex="-1" id="fq_alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_alert_title"></div>
    <div class="am-modal-bd" id="fq_alert_info">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_confirm_title"></div>
    <div class="am-modal-bd" id="fq_confirm_info"></div>
    <div class="am-modal-footer">
      <span class="am-modal-btn" data-am-modal-confirm>确定</span>
    </div>
  </div>
</div>

<div class="am-modal am-modal-confirm" tabindex="-1" id="fq_true_confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd" id="fq_true_confirm_title"></div>
    <div class="am-modal-bd" id="fq_true_confirm_info"></div>
    <div class="am-modal-footer">
		<span class="am-modal-btn" data-am-modal-confirm>确定</span>
		<span class="am-modal-btn" data-am-modal-cancel class="cancel">取消</span>
    </div>
  </div>
</div>

<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/wxinvite.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/weixin/assets/sell/css/wxkeyword.css" />
<style>
	#replay_spinner{
		display:none;
	}
</style>


	<!-- content start -->
    <div class="admin-content change_modal">
		 <div class="admin-content-body">
			<div class="am-margin-top-sm am-margin-left">
                <strong class="am-text-primary am-text-lg">邀请奖励</strong> / <small>User invite</small>
            </div>
			
			<div class="am-margin ">
				
				<div style="position: relative;top: -10px;left: 3px;margin-bottom: 5px;">
				<span class="am-icon-bullhorn" style="margin-left:-2px;"></span> 如何使用粉丝裂变（邀请奖励）功能以及使用注意事项：
				<a target="_blank" href="#">#</a>
				</div>
			
				<label class="am-checkbox am-inline-block">
					<input type="checkbox" id="auto_inter" value="0" data-am-ucheck  {$is_invite}>开启邀请<i class="am-icon-spinner am-icon-spin" id="replay_spinner"></i>
				</label>
			</div>
			<div class="am-tabs am-margin" data-am-tabs="{noSwipe: 1}">
				<ul class="am-nav am-nav-tabs keyword_nav">
						<li class="keylist keylist_sum"><a href="index.php?m=Admin&c=Weixin&a=wxinvite">邀请设置</a></li>
						<li class="keylist am-active keylist_sum"><a href="index.php?m=Admin&c=Weixin&a=wxinvitedata">具体数据</a></li>
				</ul>
				<div class="am-tabs-bd nav_content" style="touch-action: pan-y; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);">
					<div class="am-tab-panel am-fade am-active am-in">
						<div class="am-fl am-inline-block am-margin-bottom am-margin-top">													
						<!--下拉选择框-->							
							<div class="am-fl">							
								<select data-am-selected id="sorting" >					 						 
									<option value="1" >按邀请积分由高到低排列</option>	 					
								</select>							
							</div>							
						<!--下拉选择框结束-->						
						</div>
						
						<!--查询-->
						<div class="am-fr am-inline-block am-margin-bottom am-margin-top">
						
						<!--下拉选择框-->
						<div class="am-fl">
							<select data-am-selected id="my_select" >
								 <option value="0">全部</option>
								 <option value="1" class="search_UID" >按UID查询</option>
								 <option value="2" class="search_nickname">按昵称查询</option>
							</select>
						</div>
						<!--下拉选择框结束-->
						<div class="am-fr">
							<div class="am-input-group " style="width:276px;margin-left:5px;">
						    	<input type="text" value="" name="search_input" placeholder="" class="search_input am-form-field"  disabled>
						    	<span class="am-input-group-btn">
									<button class="am-btn am-btn-default search_submit" type="button" style="padding-top:5px;"><span class="am-icon-search"></span></button>
								</span>
							</div>
						</div>
						</div>
						
						<div id="score_tab">
								<table class="am-table am-table-striped am-table-hover am-text-sm user_list_table">
									<thead>
										<tr>
											<th>UID</th>
											<th>头像</th>
											<th class="am-text-center">昵称</th>
											<th class="am-text-center">积分</th> 
											<th class="am-text-center">已推广人数</th> 
											<th class="am-text-center">关注时间</th> 
										</tr>
									</thead>
									<tbody id="member_box">
										<volist name="userList" id="vo">	
										<tr>
												<td>{$vo.id}</td>
												<td>
													<img style="width:48px;height:48px;" class="am-radius" src="{$vo.wxheadpic}" />
												</td>
												<td class="am-text-center">{$vo.wxnickname}</td>
												<td class="am-text-center"> {$vo.score}</td> 
												<td class="am-text-center"> {$vo.LevelOneCount}</td> 
												<td class="am-text-center">{$vo["wxsubscribe_time"]|date="Y-m-d H:i:s",###}</td>
											 
											</tr>
											</volist>									</tbody>
								</table>
							<ul class="am-pagination am-pagination-centered am-text-xs"> 
							{$page}
							</ul>
						</div>
					</div>
				</div>	
		  </div>
		 </div>
		 <style type="text/css">	
.appmsg_content {
	position:relative;
	width:320px;
	border: 1px solid #e7e7eb;
}
.appmsg_info {
	font-size:13px;
	line-height:20px;
	padding:12px 14px 0;
}
.appmsg_item {
	position:relative;
	padding:12px 14px;
}
.appmsg_date {
	font-weight:400;
	font-style:normal;
}
.appmsg_title {
	margin:0;
	font-weight:400;
	font-style:normal;
	font-size:14px;
	line-height:28px;
	max-height:56px;
	overflow:hidden;
	word-wrap:break-word;
	word-break:break-all;
	color:#222;
	text-align:left;
}
.appmsg_thumb_wrp {
	height:160px;
	overflow:hidden;
	background-repeat: no-repeat;
	background-position:center center;
	background-size:cover;
}
.appmsg_desc {
	padding:5px 0 10px;
	margin:0;
	word-wrap:break-word;
	word-break:break-all;
}
.appmsg_content .cover_appmsg_item {
	position:relative;
	margin:22px 14px;
}
.cover_appmsg_item .appmsg_title {
	font-size:14px;
	position:absolute;
	bottom:0;
	left:0;
	right:0;
	background:rgba(0,0,0,0.6)!important;
}
.cover_appmsg_item .appmsg_title a {
	color:#fff;
}
.has_cover {
	height:102px;
	border-top:1px solid #e7e7eb;
}
.has_cover .appmsg_thumb_wrp {
	float:right;
	width:78px;
	height:78px;
	margin-left:14px;
	margin:0;
}
.has_cover .appmsg_title {
	display:inline-block;
	width:200px;
	line-height:24px;
	max-height:48px;
	overflow: hidden;
	margin-top:14px;
}
.appmsg_title a {
	display:block;
	padding:0 8px;
	color:#222;
}
.newsbox {
	width:30%;
	height:100%;
	float:left;
	margin:0 15px;
}
.newsbox .appmsg_content {
	width:100%	}
.newsbox .appmsg_title a {
	text-align:left;
}
.newsbox .has_cover .appmsg_title {
	width:180px;
}
.newsbox .appmsg_info {
	text-align: left;
}
.newsbox .appmsg_desc {
	text-align: left;
}
.newsDesc {
	position:relative;
	margin-bottom:20px;
}
.chooseNew {
	position:absolute;
	top:0;
	left:0;
	right:0;
	bottom:0;
	background-color:rgba(0,0,0,0.6);
	z-index:999;
	display:none;
}
.news_table {
	padding:15px 10px;
	height:80%;
	overflow:hidden;
	margin:0;
}
.news_content_box .mT {
	margin-top:25%;
}
.loading {
	display:block;
}
.news_content_box {
	border:1px solid #e7e7eb;
	padding:15px 0;
}
.choose_icon {
	background: transparent url(/Public/assets/sell/images/selected_mask_icon.png) no-repeat 0 0;
	width: 45px;
	height: 38px;
	position:absolute;
	top:45%;
	left:43%;
}
<!--删除修改样式开始-->	.grid_item.no_extra {
	float: none;
	width: auto;
	overflow: hidden;
}
.appmsg_opr_item {
	line-height: 44px;
	height: 44px;
	width:148px;
}
.newsbox ul {
	border-bottom: 1px solid #e7e7eb;
	border-right: 1px solid #e7e7eb;
	border-left: 1px solid #e7e7eb;
	padding-left: 0px;
	background:#e7e7eb;
	margin-bottom:20px;
	position: relative;
}
.newsbox li {
	float:left;
}
.right_del:hover {
	color:#000;
}
.li_left {
	border-right:0.5px solid #ccc;
	cursor:pointer;
}
.li_right {
	cursor:pointer;
}
<!--警告框样式开始-->	.popover {
	width: 290px;
}
.del_confirm .popover {
	display:none;
	position: absolute;
	margin-top: 12px;
	z-index:2001;
}
.del_confirm .popover .popover_inner {
	border: 1px solid #d9dadc;
	word-wrap: break-word;
	word-break: break-all;
	padding: 30px;
	background-color: #fff;
	-webkit-box-shadow: none;
	width:216px;
	height:136px;
}
.tl {
	text-align: left;
}
.del_confirm .popover_content p {
	display: block;
	-webkit-margin-before: 1em;
	-webkit-margin-after: 1em;
	-webkit-margin-start: 0px;
	-webkit-margin-end: 0px;
	margin: 0;
}
.popover .popover_bar {
	text-align: justify;
	text-justify: distribute-all-lines;
	font-size: 0;
	width:100%;
}
.popover .popover_bar .btn {
	/*margin-top: 18px;*/
	
}
.btn {
	min-width: 60px;
	display: inline-block;
	overflow: visible;
	padding: 0 22px;
	height: 30px;
	line-height: 30px;
	vertical-align: middle;
	text-align: center;
	text-decoration: none;
	border-radius: 3px;
	-moz-border-radius: 3px;
	-webkit-border-radius: 3px;
	font-size: 14px;
	border-width: 1px;
	border-style: solid;
	cursor: pointer;
	margin-left:12px;
}
.btn_primary {
	background-color: #44b549;
	background-image: -moz-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: -webkit-gradient(linear,0 0,0 100%,from(#44b549),to(#44b549));
	background-image: -webkit-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: -o-linear-gradient(top,#44b549 0,#44b549 100%);
	background-image: linear-gradient(to bottom,#44b549 0,#44b549 100%);
	border-color: #44b549;
	color: #fff;
	margin-top:18px;
	margin-left:0px;
}
.popover_bar a {
	outline: 0;
}
.btn_primary:hover {
	color:fff;
}
.btn_default:hover {
	background-color: #e7e7eb;
	background-image: -moz-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: -webkit-gradient(linear,0 0,0 100%,from(#e7e7eb),to(#e7e7eb));
	background-image: -webkit-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: -o-linear-gradient(top,#e7e7eb 0,#e7e7eb 100%);
	background-image: linear-gradient(to bottom,#e7e7eb 0,#e7e7eb 100%);
	border-color: #dadbe0;
	box-shadow: none;
	-moz-box-shadow: none;
	-webkit-box-shadow: none;
	color: #000;
	!important
}
.btn_default {
	margin-top:18px;
	margin-right:-10px;
	border:#e7e7eb solid 1px;
	color:#000;
}
.btn:hover {
	text-decoration: none;
}
.t1 {
	font-size:14px;
}
.del_confirm .popover .popover_arrow_out {
	top: 0;
}
.del_confirm .popover .popover_arrow {
	position: absolute;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	display: inline-block;
	width: 0;
	height: 0;
	border-width: 8px;
	border-style: dashed;
	border-color: transparent;
	border-top-width: 0;
	border-bottom-color: #d9dadc;
	border-bottom-style: solid;
}
.del_confirm .popover .popover_arrow_in {
	border-bottom-color: #fff;
	top: 1px;
}
.edit_confirm .speech-bubble {
	display:none;
	position: absolute;
	background-color: #666;
	margin-left: auto;
	margin-right: auto;
	width: 35px;
	height: 27px;
	line-height: 27px;
	/* 垂直居中*/
	color: white;
	text-align: center;
	/*border-radius: 10px;
	font-family: sans-serif;*/
	bottom:55px;
	left:55px;
}
.edit_confirm p {
	font-size:12px;
}
.edit_confirm .speech-bubble:after {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border: 5px solid;
}
.edit_confirm .speech-bubble-bottom:after {
	border-top-color: #666;
	top: 100%;
	left: 74%;
	margin-left: -15px;
}
.del_confirm .speech-bubble {
	display:none;
	position: absolute;
	background-color: #666;
	margin-left: auto;
	margin-right: auto;
	width: 35px;
	height: 27px;
	line-height: 27px;
	/* 垂直居中*/
	color: white;
	text-align: center;
	/*border-radius: 10px;
	font-family: sans-serif;*/
	bottom:55px;
	right:51px;
}
.del_confirm p {
	font-size:12px;
}
.del_confirm .speech-bubble:after {
	content: '';
	position: absolute;
	width: 0;
	height: 0;
	border: 5px solid;
}
.del_confirm .speech-bubble-bottom:after {
	border-top-color: #666;
	top: 100%;
	left: 74%;
	margin-left: -15px;
}
<!--警告框样式结束-->	<!--介绍-->
</style>
 
<!--回复图文项 start-->
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-news" data-id="3">
		<div class="am-modal-dialog">
		   	<div class="am-modal-hd modal-hd-top">
		   		选择图文素材
		        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
		    </div>
		    <div class="am-cf">
				<button type="button" style="background:#5eb95e;border-color:#5eb95e;border-radius:3px;" class="am-margin-sm am-fl am-btn am-btn-secondary type_news getMaterial">重新获取图文</button>
				<button type="submit" class="am-fl am-btn am-margin-sm am-btn-secondary" id="material_up" style="display:none;margin-left:0px;background:#5eb95e;border-color:#5eb95e; border-radius:3px;" disabled data-start="">上一页</button>
				<button type="submit" class="am-fl am-margin-sm am-btn am-btn-secondary" style="margin-left:0px;background:#5eb95e;border-color:#5eb95e;border-radius:3px;display:none;"  id="material_down" data-start="">下一页
				</button>
				<button type="button" class="am-btn am-btn-secondary" style="float:right;margin-right:21px;margin-top:10px;"><a href="/wxmaterial/createnews.html" target="_blank" style="color:#fff;">+ 新建图文消息</a></button>
		    </div>
		    <div class="news_table">
		    	<div class="news_content_box" style="width:100%;height:100%;overflow:overlay;">
		    		<div class="loading mT">
		    			<i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候
		    		</div>
		    	</div>
		    </div>
		    <button type="submit" class="am-btn am-btn-secondary am-disabled" data-am-modal-close="" data-id="" id="edit_news" data-src="" data-title="" data-edit="0">确认选择</button>
		    <button type="reset" class="am-btn am-btn-secondary" style="width:98px;" data-am-modal-close="" class="modal-close">取&nbsp;&nbsp;消</button>
		</div>
	</div>
	<!--回复图文项 end-->
	
	
	<!--回复图片项 star-->
	<div class="am-modal am-modal-no-btn" tabindex="-1" id="doc-modal-image" data-id="2">
    
		<div class="am-modal-dialog">
		   	<div class="am-modal-hd modal-hd-top">选择图片
		        <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="">×</a>
		    </div>
		    <div class="image_table">
		    	<form method="post" enctype="multipart/form-data" name="form_image" id="image_upload" action="/wxautoreply/local_image.html " style="display:none;" >
						<input type="file" name="upload_image" value="" class="addimage" style="opacity:0" id="upload_image"  accept="image/*" multiple="multiple"/>
					</form>
		    	<div class="file_local"> 
					<button type="button" id="image_agin" class="image_model am-fl am-btn am-btn-secondary" style="margin-left:10px;border-radius:3px;background:#5eb95e;border-color:#5eb95e;" >重新获取图片</button>
					<button id="last_image" type="button" class=" am-fl am-btn am-btn-secondary" disabled style="margin-left:10px;background:#5eb95e;border-color:#5eb95e;display:none;border-radius:3px;" data-start="" />上一页
					</button>
					<button id="next_image" type="button" class="am-fl am-btn am-btn-secondary" style="display:none;margin-left:10px;background:#5eb95e;border-color:#5eb95e;border-radius:3px;" data-start="" />下一页
					</button>
		    		<button type="button" class="am-btn am-btn-secondary file_image" style="float:right;margin-right:10px;" >本地上传</button>
		    	</div>
		    	<div class="image_list" style="margin-top:32px;"><i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i></div>
				<div class="ima_showbutton">
					
				</div>
		    </div>
		    <button type="submit" class="am-btn am-btn-secondary am-disabled" data-am-modal-close="" id="edit_image" data-id="" data-edit="0">确认选择</button>
		    <button type="reset" class="am-btn am-btn-secondary" style="width:98px;" data-am-modal-close="" class="modal-close">取&nbsp;&nbsp;消</button>
		</div>
        
	</div>
	<!--回复图片项 end-->
	
	<script>
		$(function(){
			//选择图文
			$('.news_content_box').on('mouseover','.newsDesc',function(){
				$('.chooseNew').hide();
				$('.choose').siblings('.chooseNew').show();
				$(this).children('.appmsg_content').css('border','1px solid #5eb95e');
				$('.choose').css('border','1px solid #e7e7eb');
			});
			$('.news_content_box').on('mouseout','.newsDesc',function(){
				$('.chooseNew').hide();
				$('.choose').siblings('.chooseNew').show();
				$('.newsDesc .appmsg_content').css('border','1px solid #e7e7eb');
			})

			$('.news_content_box').on('click','.newsDesc',function(){
				$('.newsbox .appmsg_content').removeClass('chooseicon');
				$('.newsbox .appmsg_content').removeClass('choose');
				$('.chooseNew').hide();
				$(this).children('.chooseNew').show();
				$(this).children('.chooseNew').html('<div class="choose_icon"></div>');
				$(this).children('.appmsg_content').addClass('choose');
				$('#edit_news').removeClass('am-disabled');
			});

			$('.getMaterial').click(function(){
				$('.newsbox').remove();
				$('.news_content_box').html('<div class="loading mT"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
			});
			//图文列表
			$('.type_news').click(function(){
				
				var news_content_length= $('.news_content_box').html().length;
				$('.type_news').ajaxSubmit({
					data:{"type":3},
					type:'post',
					url:'/wxmaterial/getnews.html',
					beforeSubmit:function(){
						if(news_content_length>129){
							return false;
						};
					},
					success:function(data){
						var $newsList = data.list;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						$('#material_up').attr('data-start',0);
						$('#material_down').attr('data-start',10);
						$('#material_up').attr('disabled',true);
						$('#material_down').attr('disabled',false);
						if($newsList.length<data.count){
							$('#material_up').css('display','block');
							$('#material_down').css('display','block');
						}else{
							$('#material_up').css('display','none');
							$('#material_down').css('display','none');
						}
						
					}
				});
			});
			
			//重新获取图片
			$('#image_agin').click(function(){
			
				$('.show_image').remove();
				$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
			
			})
			
			//图片模态框显示
			$('.image_model').click(function(){
			$('.image_model').ajaxSubmit({
				url:"/wxautoreply/image_how.html",
				type:'get',
				//data:{'start':$('#next_image').attr('data-start')},
				beforeSubmit:function(){
					if($('.image_list').html().length>80){
								return false;
							}
				},
				success:function(data){
					var $image_array = data.array; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($image_array.length<data.count){
						$('#next_image').css('display','block');
						$('#last_image').css('display','block');
					}else{
						$('#next_image').css('display','none');
						$('#last_image').css('display','none');
					}
				},
				error:function(){
					console.log("失败");
				}
			});
			$('#next_image').attr('data-start',20);
			$('#last_image').attr('data-start',0);
	})
	
	
		});
//下一页图片
$("#next_image").click(function(){
		$('.show_image').remove();
		$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
		$.ajax({
				url:"/wxautoreply/image_how.html",
				type:'get',
				data:{'start':$('#next_image').attr('data-start')},
				success:function(data){
					var $image_array = data.array; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($image_array!=''){
						var next_image = parseInt($('#next_image').attr('data-start'));
						var next_image_start = next_image+20;
						$('#next_image').attr('data-start',next_image_start);
						var last_image = parseInt($('#last_image').attr('data-start'));
						var last_image_start =	next_image-20;
						$('#last_image').attr('data-start',last_image_start);
						$('#last_image').attr('disabled',false);
					}else{
						$('.image_list').html('<div style="margin-top:255px;">没有了</div>');
						$('#next_image').attr('disabled',true);
						var rest_last_image = parseInt($('#last_image').attr('data-start'))+20;
						$('#last_image').attr('data-start',rest_last_image);
					}
				},
			});
})
//上一页图片
$("#last_image").click(function(){
	$('.show_image').remove();
		$('.image_list').html('<i class="am-icon-refresh am-icon-spin am-icon-sm" style="margin-top:255px"></i>');
		$.ajax({
				url:"/wxautoreply/image_how.html",
				type:'get',
				data:{'start':$('#last_image').attr('data-start')},
				success:function(data){
					var $image_array = data.array; 
					var image_show = "";
					for(var i =0;i< $image_array.length;i++){
						image_show +='<div class="show_image"><div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src="'+$image_array[i]['url']+'" alt="" data-id ="'+$image_array[i]['media_id']+'" class="selected_image"></div>';
					}
					$('.image_list').html(image_show);
					if($("#next_image").attr('disabled')){
						var a = parseInt($("#next_image").attr('data-start'))+20;
						$("#next_image").attr('data-start',a);
						//var b =	parseInt($("#last_image").attr('data-start'))+20;
						//$("#last_image").attr('data-start',b);
					}
					var last_image = parseInt($('#last_image').attr('data-start'));
					var last_image_start = last_image-20;
					$('#last_image').attr('data-start',last_image_start);
					var next_image = parseInt($('#next_image').attr('data-start'));
					var next_image_start = next_image-20;
					$('#next_image').attr('data-start',next_image_start);
					$('#next_image').attr('disabled',false);
					if($('#last_image').attr('data-start')<0){
						$('#last_image').attr('disabled',true);
					}
				},
			});
})


//上传图片
$('.file_image').click(function(){
	$('.addimage').click();
});
$('#upload_image').change(
	function(){
	$('.image_table .show_image').eq(0).before('<div class="show_image"><span class="text_center"><i class="am-icon-refresh am-icon-spin"></i> 上传中</span></div>');
			if($('.image_table .show_image').length>=20){
				$('.image_table .show_image:last-child').remove();
			}
			$('#edit_image').attr('disabled',true);
			$('.file_image').attr('disabled',true);
			$('.file_image').html('<i class="am-icon-spinner am-icon-spin"></i> 上传中');
			$('#image_upload').ajaxSubmit({
				dataType:'json',
				success:function(data){
					if(data.info == 1){
						$('#edit_image').attr('disabled',false);
						$('.file_image').attr('disabled',false);
						$('.file_image').html('本地上传');
						
					$('.image_table .show_image').eq(0).html('<div class="selected_mask"><div class="selected_mask_inner"></div><div class="selected_mask_icon"></div></div><img src='+data.image_url+' alt="" class="selected_image">');
					}
				}
			});
		}
	
	);

//下一页图文
$('#material_down').click(function(){
	$('.newsbox').remove();
	$('.news_content_box').html('<div class="loading mT" style="display:block;"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
	var start = $(this).attr('data-start');
	var end   = $(this).attr('data-num');
	$.ajax({
	
		data:{"type":3,"start":start,"end":end},
		type:'post',
		url:'/wxmaterial/getnews.html',
		success:function(data){
			if(data.info == 1){
				var $newsList = data.list;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						if(data.list!=''){
											var material_down_start = parseInt($('#material_down').attr('data-start'));
											var material_up_reststart = material_down_start-10;
											$('#material_up').attr('data-start',material_up_reststart);
											var material_down_reststart = material_down_start+10;
											$('#material_down').attr('data-start',material_down_reststart);
											$('#material_up').attr("disabled",false);
										}else{
												$('.news_content_box').html('<div class="loading mT" style="display:block;">没有了...</div>');
												var rest_upstart= parseInt($('#material_up').attr('data-start'))+10;
												$('#material_up').attr('data-start',rest_upstart);
												$('#material_down').attr("disabled",true);
												$('#material_up').attr("disabled",false);
										}
			}
		}
	})
});

//上一页图文
$('#material_up').click(function(){
	$('.newsbox').remove();
	$('.news_content_box').html('<div class="loading mT" style="display:block;"><i class="am-icon-refresh am-icon-spin am-icon-md"></i> 获取中,请稍候</div>');
	var start = $(this).attr('data-start');
	var end   = $(this).attr('data-num');
	$.ajax({
		data:{"type":3,"start":start,"end":end},
		type:'post',
		url:'/wxmaterial/getnews.html',
		success:function(data){
			if(data.info == 1){
				var $newsList = data.list;
						var content = '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 0){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover" id=""><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 1){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item"><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						content += '<div class="newsbox">';
						for(var i=0;i<$newsList.length;i++){
							if(i%3 == 2){
								content +='<div class="newsDesc" id="'+$newsList[i]['media_id']+'"><div class="chooseNew"></div><div class="appmsg_content" data-id="'+$newsList[i]['media_id']+'"><div class="appmsg_info"><em class="appmsg_date"></em></div>';
								for(var j=0;j<$newsList[i]['content']['news_item'].length;j++){
									if($newsList[i]['content']['news_item'].length == 1){
										content += '<div class="appmsg_item '+$newsList[i]['media_id']+'" id=""><h4 class="appmsg_title js_title">'+$newsList[i]['content']['news_item'][j]['title']+'</h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div><p class="appmsg_desc">'+$newsList[i]['content']['news_item'][j]['digest']+'</p></div>';
									}else{
										if(j == 0){
											content += '<div class="cover_appmsg_item"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}else{
											content += '<div class="appmsg_item has_cover"><h4 class="appmsg_title js_title"><a href="javascript:void(0);">'+$newsList[i]['content']['news_item'][j]['title']+'</a></h4><div class="appmsg_thumb_wrp" style="background-image:url('+$newsList[i]['content']['news_item'][j]['thumb_url']+')"></div></div>';
										}
									}
								}
								content += '</div></div>';
							}
						}
						content += '</div>';
						$('.news_content_box').html(content);
						if($('#material_down').attr('disabled')){
							var down_start =  parseInt($('#material_down').attr('data-start'))+10;
							$('#material_down').attr('data-start',down_start);
						}
						$('#material_down').attr('disabled',false);
						var par_start =  parseInt($('#material_up').attr('data-start'))-10;
						$('#material_up').attr('data-start',par_start);
						var down_start = parseInt($('#material_down').attr('data-start'))-10;
						$('#material_down').attr('data-start',down_start);
						if($('#material_up').attr('data-start')<0){
							$('#material_up').attr('disabled',true);
						}
			}
		}
	})
});


//选择图片素材
$('.image_table').on('click','.selected_image',function(){	
	var image_id = $(this).attr('data-id');
	$('#edit_image').attr('data-id',image_id);
	$('.selected_mask').css({'display':'none'});
	$(this).siblings('.selected_mask').css({'display':'block'});
	$(".selected_image").removeClass("choose_image");
	$(this).addClass("choose_image");
	if(image_id!=''){
		$('#edit_image').removeClass('am-disabled');
	}else{
		$('#edit_image').addClass('am-disabled');
	}

});


$('#edit_image').click(function(){
	$('#edit_image').addClass('am-disabled');
	$('.selected_mask').hide();
});
		
</script>
        <footer class="admin-content-footer">
	<hr>
	<p class="am-padding-left">淘优惠 微信淘客系统 版权所有  Copyright © 2004-2016 爱淘客(www.itaoke.org).All Rights Reserved</p>
</footer>
	</div>
</div>
<div class="am-hide"> </div>					
</html>

<script src="__STATIC__/weixin/assets/sell/js/jquery.form.js"></script>
<script src="__STATIC__/weixin/assets/sell/js/wxinvite.js"></script>

<script>
	//开启邀请
	$('#auto_inter').click(function(){
		 $('#replay_spinner').show();
		 if ($('#auto_inter').prop('checked') == true) {
            $.ajax({
                url: "index.php?m=Admin&c=Weixin&a=wxisinviteropen",
                type: 'get',
                data: { 'is_invite':1 },
                success: function (data) {
                    if (data.info == 1) {
                        $('#auto_inter').val(0);
                        $("#fq_confirm_info").text("成功启用邀请功能！");
                        $('#fq_confirm').modal();
					
                    }
                    $('#replay_spinner').hide();
                }
            });
        }else {
            
            $.ajax({
                url: "index.php?m=Admin&c=Weixin&a=wxisinviteropen",
                type: 'get',
                data: { 'is_invite': 0 },
                success: function (data) {
                    $("#fq_confirm_info").html("邀请功能已关闭！");
                    $('#fq_confirm').modal();
                    $('#replay_spinner').hide();
					
                }
            });
        }
	})
	
	$('#my_select').change(function(){
	
		if($(this).val()==1){			
			$('.search_input').attr('disabled',false);
			$('.search_input').attr('placeholder',"用户UID");
			$('.search_input').show();
			$('.search_submit').show();			
		}
		
		if($(this).val()==2){			$('.search_input').attr('disabled',false);
			$('.search_input').attr('placeholder',"用户昵称");
			$('.search_input').show();
			$('.search_submit').show();						
		}
		
		//查询全部
		if($(this).val() == 0){
			$('#keyword_list').css("width","100%");
			$('#score_tab').css("text-align","center");
			$('#score_tab').html('<div style="width:100%;height:100%;padding-top:110px;"><i class="am-icon-refresh am-icon-spin"></i>&nbsp;正在查询中,请稍候!</div>');			$('.search_input').attr('disabled',true);
			
			/*
			$.get("/wxinvite/search_user.html",{'type':$(this).val()},function(data){
				$('#score_tab').html(data);
			})*/
			window.location.href = 'index.php?m=Admin&c=Weixin&a=wxinvitedata';
		
		}
	})
	
	//查询
	$('.search_submit').click(function(){		
	if($('#my_select').val()!=0){
		$('#score_tab').css("text-align","center");
		$('#keyword_list').css("width","100%");
		$('#score_tab').html('<div style="width:100%;height:100%;padding-top:110px;"><i class="am-icon-refresh am-icon-spin"></i>&nbsp;正在查询中,请稍候!</div>');
		var search_kw = $('.search_input').val();
		var type = $('#my_select').val();
		/*	
						
			$.get("/wxinvite/search_user.html",{'keyword':search_kw,'type':type},function(data){				
					$('#score_tab').html(data);			
				})
		
		*/
		
		window.location.href = 'index.php?m=Admin&c=Weixin&a=wxinvitedata&search_member='+search_kw+'&type='+type;
		}
	})
	
	//排序
		$('#sorting').change(function(){
			
			if($(this).val()==0){
				
				window.location.href ="/wxinvite/invite_data/type/0";
			}
			
			if($(this).val() == 1){
				window.location.href ="/wxinvite/invite_data/type/1";
			}
			
			if($(this).val() == 2){
			
				window.location.href ="/wxinvite/invite_data/type/2";
			}
		});

</script>